#define  _CRT_SECURE_NO_WARNINGS 1

#include "stack.h"
#include "queue.h"

void test_stack()
{
	zzh::stack<int, vector<int>> st1;
	st1.push(1);
	st1.push(2);
	st1.push(3);
	st1.push(4);
	st1.push(5);
	st1.push(6);

	while (!st1.empty())
	{
		st1.top() *= 10;
		cout << st1.top() << " ";
		st1.pop();
	}
	cout << endl;

	zzh::stack<double> st2;
	st2.push(1.12);
	st2.push(2.22);
	st2.push(3.33);
	st2.push(4.44);
	st2.push(5.55);
	st2.push(6.66);

	while (!st2.empty())
	{
		st2.top() *= 10;
		cout << st2.top() << " ";
		st2.pop();
	}
	cout << endl;
}

void test_queue()
{
	zzh::queue<int> q1;
	q1.push(1);
	q1.push(2);
	q1.push(3);
	q1.push(4);
	q1.push(5);
	q1.push(6);
	q1.push(7);
	cout << "front: " << q1.front() << endl;
	cout << "back: " << q1.back() << endl;
	while (!q1.empty())
	{
		q1.front() *= 10;
		cout << q1.front() << " ";
		q1.pop();
	}
	cout << endl;

	zzh::queue<double> q2;
	q2.push(1.11);
	q2.push(2.22);
	q2.push(3.33);
	q2.push(4.44);
	q2.push(5.55);
	q2.push(6.66);
	q2.push(7.77);
	cout << "front: " << q2.front() << endl;
	cout << "back: " << q2.back() << endl;
	while (!q2.empty())
	{
		q2.front() *= 10;
		cout << q2.front() << " ";
		q2.pop();
	}
	cout << endl;
}

int main()
{
	test_queue();

	return 0;
}